import {GetExamNoticeByExaminee,GetExamNoticeByExamineeOut} from "../../api/api.js"
export default{
		namespaced: true,//命名空间必须写
		state: {
			// 第一个页面参t数
			systemBarHeight:0,
			notice:{},
			noticeout:{}
		},
		getters:{
			getNotice(state){
				return state.notice;
			},
				getNoticeOut(state){
					return state.noticeout;
				},
		},
			//唯一修改state值的方法 
			// commit
		mutations: {
			GET_NOTICE:(state,payload)=>{
				
				state.notice=payload
			},
			GET_NOTICE_OUT:(state,payload)=>{
				console.log(payload,'payload')
				state.noticeout=payload
			},
			SET_SBHEIGHT:(state,payload)=>{
	
				state.systemBarHeight=payload
			},
			
		},
		// 异步的操作
			// dispatch
	  actions: {
			  async Agetnotice({ commit },payload) {
			            try {
							
							GetExamNoticeByExaminee().then(res=>{
								
								  commit('GET_NOTICE', res.Data);
							})
			              
			              
			            } catch (error) {
							
			            }
			        },
					async AgetnoticeOut({ commit },payload) {
							
						return new Promise((resolve,rej)=>{
							try {
							GetExamNoticeByExamineeOut().then(res=>{
									
													  commit('GET_NOTICE_OUT', res.Data);
												})
							    
							    
							  } catch (error) {
										
							  }
						})
					   
					      },
					
		}
}